Conversation
9d6626b to
d3bb061
Compare
nik-localstack
left a comment
There was a problem hiding this comment.
LGTM with two questions:
-
It seems that the agent didn't catch the instructions added about identifying read-only operations as there are for example BatchGetServiceLevelObjectiveBudgetReport or FilterLogEvents. Should we modify the instructions ?
-
Do we want to release a new version of the extension with these changes ?
Great catch - thanks for the detailed review @nik-localstack ! 🙌 This actually still dates back to the time before we extended the AGENT.md instructions (PR has been in draft state for a while), will ask the agent to update/extend the tests based on this. 👍
Good point - I have another set of tests and small logic changes coming up in #119, perhaps it could make sense to release a new version once that one is reviewed&merged. 👍 |
- Add test file with tests for CloudWatch Metrics and CloudWatch Logs - Fix service name mapping (monitoring -> cloudwatch) in auth_proxy and forwarder - Use botocore service model for protocol compatibility (LocalStack uses smithy-rpc-v2-cbor, boto3 uses query protocol) - Implement resource name matching for CloudWatch and CloudWatch Logs Tests added: - test_cloudwatch_metric_operations: PutMetricData and ListMetrics - test_cloudwatch_alarm_operations: PutMetricAlarm and DescribeAlarms - test_cloudwatch_readonly_operations (xfail): read-only mode - test_cloudwatch_resource_name_matching (xfail): resource pattern matching - test_logs_group_operations: CreateLogGroup and DescribeLogGroups - test_logs_stream_and_events: log streams and events - test_logs_readonly_operations: read-only mode for logs - test_logs_resource_name_matching: resource pattern matching for logs - test_logs_filter_log_events: FilterLogEvents operation Known limitations (2 xfail tests): - CloudWatch read_only and resource_name_matching: form data stream consumed by LocalStack before proxy can access it (Query protocol issue) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add DELETE endpoint to remove proxies from PROXY_INSTANCES - Add deregister_from_instance() method in auth_proxy.py - Update test fixture to deregister proxies during cleanup - Remove xfail markers from CloudWatch tests that now pass - Add _reconstruct_request_body for Query protocol services - Add resource name matching for CloudWatch and CloudWatch Logs Co-Authored-By: Claude Opus 4.5 <[email protected]>
d3bb061 to
dbd3e14
Compare
- Add test_logs_readonly_filter_log_events to verify FilterLogEvents works in read_only mode - Add test_logs_readonly_insights_query to verify StartQuery/GetQueryResults work in read_only mode - Update AGENTS.md with instruction to avoid time.sleep() in tests Co-Authored-By: Claude Opus 4.5 <[email protected]>
Operations like GetQueryResults, StopQuery, and DescribeQueries use queryId instead of logGroupName, so they should be proxied when the logs service is configured regardless of resource pattern. Co-Authored-By: Claude Opus 4.5 <[email protected]>
CloudWatch Logs Insights can complete a query with 0 results if log events weren't indexed when the query started. Retry the entire query cycle (start + poll) if it completes with no results. Co-Authored-By: Claude Opus 4.5 <[email protected]>
68cea3a to
b017e90
Compare
Focus on verifying the proxy forwards StartQuery and GetQueryResults correctly rather than waiting for actual query results. The query ID format and matching status between proxy and direct AWS calls proves the operations are being proxied. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Query status can change between proxy and direct AWS calls, so just verify both return valid statuses rather than comparing exact values. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add proxy tests for the CloudWatch service (metrics + logs)
Tests added: